package com.app.controller;


import com.app.entity.Orders;
import com.app.entity.Params.ProductSearchParams;
import com.app.service.OrdersService;
import com.app.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author lkg
 * @since 2021-04-14
 */
@RestController
@RequestMapping("/orders")
public class OrdersController {
    @Autowired
    private OrdersService ordersService;

    @RequestMapping("/findOrdersAndProduct")
    public Result findOrdersAndProduct(@RequestBody() ProductSearchParams productSearchParams) {

        return ordersService.findOrdersAndProduct(productSearchParams.getTime());
    }

    //新增订单数
    @RequestMapping("/findOederNum")
    public Result findOederNum() {
        return ordersService.findOederNum();
    }


    @RequestMapping("/editOrders")
    public Result editOrders(@RequestBody Orders orders) {
        return ordersService.editOrders(orders);
    }
}

